Skip to content

fix: tier 1 audit fixes — crashes, UI freezes, broken localization#589

Merged
datlechin merged 7 commits intomainfrom
fix/tier1-audit-fixes
Apr 6, 2026
Merged

fix: tier 1 audit fixes — crashes, UI freezes, broken localization#589
datlechin merged 7 commits intomainfrom
fix/tier1-audit-fixes

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Addresses the highest-priority issues from the full codebase audit (AUDIT.md). Three independent fixes across 58 files:

  • ForEach crash preventionForEach($array) { $item in on mutable struct arrays causes out-of-bounds crashes when items are removed. Replaced with ID-based safe binding lookup via new Binding+SafeLookup extension in ConnectionSSHTunnelView, SSHProfileEditorView, and ExportTableTreeView.

  • Sheet presentation for promptsPasswordPromptHelper and PromptTOTPProvider used runModal() which freezes the entire app. Now use beginSheetModal(for:) as sheets on the active window, with runModal() fallback when no window is available.

  • Localization fix — 112 instances of String(localized: "text \(var)") across 50 files created dynamic keys that never match the strings catalog. All replaced with String(format: String(localized: "text %@"), var).

Test plan

  • SSH tunnel: add 3 jump hosts → delete the middle one → no crash
  • SSH tunnel: reorder jump hosts via drag → no crash
  • SSH profile editor: same jump host add/delete/reorder tests
  • Export dialog: open → switch database type → tree refreshes without crash
  • Connect with prompt-for-password enabled → password sheet appears on key window (not floating modal)
  • Cancel password prompt → connection cancelled correctly
  • SSH with TOTP prompt mode → verification code sheet appears on key window
  • Verify localized strings display correctly (spot check status bar row counts, export dialog buttons, plugin error messages)
  • Build succeeds with zero String(localized: interpolation violations

@datlechin datlechin merged commit 162f3ab into main Apr 6, 2026
2 checks passed
@datlechin datlechin deleted the fix/tier1-audit-fixes branch April 6, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant